<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	/**
	 *1、basePath设置
	 *2、themePath设置
	 */
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	/**
	 *1、判断是否设置theme
	 *2、如果没有则按默认
	 */
	Object themePath = session.getAttribute("themePath");
	if (themePath == null)
	{
		themePath = "default";
	}
%>
<html>
	<head>
		<script type="text/javascript">
		function saveToExcel(fileName){
			//grid中的.datagrid-view2为表格内容
			var valHtml = $(".datagrid-view2").html();
			$('#ToExcel').form('submit',{
					url: "portal/exportExcel.action",
					onSubmit: function(){
					 	$("#tableContent").attr("value",valHtml);
					 	if(fileName==null){
					 		fileName = "export";
					 	}
					 	$("#fileName").attr("value",fileName);
						var flag =  true;
						return flag;
					},
					success: function(result){
						alert(result);
					},
					onLoadError:function(){
						alert("error");
					},
					onLoadSuccess:function(){
						alert("success");
					}
				});
		}
		</script>
	</head>
	<body>
		<form name="ToExcel" id="ToExcel" method="post"
			action="portal/exportExcel.action" target="_blank"
			style="display: none">
			<input type="hidden" id="tableContent" name="tableContent" value=""
				readonly />
			<input type="hidden" id="fileName" name="fileName" value="" readonly />
		</form>
	</body>
</html>